package com.yiqi.liebang.feature.home.model;

import com.suozhang.framework.component.http.RxDataProcessFactory;
import com.suozhang.framework.entity.bo.UserInfoBo;
import com.yiqi.liebang.entity.bo.HomeBo;
import com.yiqi.liebang.feature.home.contract.HomeContract;
import com.yiqi.liebang.feature.home.dependencies.home.DaggerHomeModelComponent;
import com.yiqi.liebang.framework.api.ApiLib;
import com.yiqi.liebang.framework.api.HomeApi;
import com.yiqi.liebang.framework.api.UserApi;
import io.reactivex.Observable;

import javax.inject.Inject;

public class HomeModel implements HomeContract.Model {

    @Inject
    HomeApi api;


    @Inject
    public HomeModel() {

        DaggerHomeModelComponent.builder().apiComponent(ApiLib.apiComponent()).build().inject(this);
    }


    @Override
    public Observable<HomeBo> getHomeData() {
        return api.getHomeData().compose(RxDataProcessFactory.dataPrepAndIoToMainTransformer());
    }
}
